package com.geeguo.ebuilder.client.base.core.dictionary;

import com.geeguo.ebuilder.core.common.dictionary.IDictionary;

import java.util.Arrays;
import java.util.List;

public enum ClientTypeEnum implements IDictionary {

    Web(1, "Web端"),
    App(2, "移动端");

    private final int value;
    private final String label;

    ClientTypeEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public static List<ClientTypeEnum> getEnumValues() {
        return Arrays.asList(values());
    }

    public static ClientTypeEnum parse(int value) {
        for (ClientTypeEnum item : ClientTypeEnum.values()) {
            if (value == item.getValue()) {
                return item;
            }
        }
        return null;
    }
}